import { Component, ComponentFactoryResolver } from '@angular/core';
import { HttpService } from './core/service/http.service';
import { NzMessageService } from 'ng-zorro-antd';
import { SignalRService } from './core/service/singnalr-service';
import { AuthService } from '.';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'app';
  constructor(
    public signalService: SignalRService,
    public Auth: AuthService) {
    if (this.Auth.token && this.Auth.token.userid) {
      // 注册sockect登陆信息
      this.signalService.startConnection();
      // this.signalService.connectionEstablished.subscribe(e => {
      //   // this.signalService.RgisterUser(this.Auth.token.userid).then(e1 => this.signalService.IniChatContext());
      // });
    }
  }
}
